<?php
PageUtil::addVar("javascript_body","<script type=\"text/javascript\" src=\"".$themepath."/framework/ckeditor/ckeditor.js\"></script>");

?>
<div class="content_block col-xs-12 col-sm-12 col-md-12 col-lg-12">
  <form action="<?php if(!empty($comList["pos_id"])){ echo base_url('restaurant/review/'.$comList["pos_id"]); } else {base_url('restaurant/review/'.$pos_id);} ?>" id="signup-form" class="form-horizontal" role="form" method="post">
    <h2>เพิ่มรีวิว</h2>
      <div class="form-group">
        <div class="col-sm-3"></div>
        </div>
      <div class="form-group">
        <label class="col-sm-2 control-label" for="username">ไฮไลท์</label>
        <div class="col-sm-6">
          <input type="text" class="col-sm-6 form-control required" name="title" id="title" placeholder="หัวข้อหลัก..." value="<?php if(!empty($comList["title"])){ echo $comList["title"]; }?>">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label" for="address">รายละเอียด</label>
        <div class="col-sm-9">
          <textarea id="editor1" class="ckeditor" name="content"><?php if(!empty($comList["content"])){ echo $comList["content"]; }?></textarea>
        </div>
      </div>
      <div class="hidden">
        <?php 
          $dateTime = new DateTime('now', new DateTimeZone('Asia/Bangkok'));
        ?>
        <input type="text" class="col-sm-6 form-control required" name="id" id="id" value="<?php if(!empty($comList["id"])){ echo $comList["id"]; }?>">
        <input type="text" class="col-sm-6 form-control required" name="usr_ip" id="usr_ip" value="<?php if(!empty($comList["usr_ip"])){ echo $comList["usr_ip"]; }?>">
        <input type="text" class="col-sm-6 form-control required" name="status" id="status" value="<?php if(!empty($comList["status"])){ echo $comList["status"]; }?>">
        <input type="text" class="col-sm-6 form-control required" name="pos_id" id="pos_id" value="<?php if(!empty($comList["pos_id"])){ echo $comList["pos_id"]; } else {echo $pos_id;} ?>">
        <input type="text" class="col-sm-6 form-control required" name="parent_id" id="parent_id" value="<?php if(!empty($comList["parent_id"])){ echo $comList["parent_id"]; } if (!empty($parent_id)){ if ($parent_id=="edit" || $parent_id=="add"){echo "";} else {echo $parent_id; }} ?>">
        <input type="text" class="col-sm-6 form-control required" name="usr_id" id="usr_id" value="<?php echo $user["id"];?>">
        <input type="text" class="col-sm-6 form-control required" name="cr_date" id="cr_date" value="<?php if(!empty($comList["cr_date"])){ echo $comList["cr_date"]; } else {echo $dateTime->format('Y-m-d H:i:s');} ?>">
        <input type="text" class="col-sm-6 form-control required" name="lu-uid" id="lu-uid" value="<?php echo $user["id"];?>">
        <input type="text" class="col-sm-6 form-control required" name="lu_date" id="lu_date" value="<?php echo $dateTime->format('Y-m-d H:i:s'); ?>">
      </div>
      <div class="form-group">
        <div class="col-sm-offset-5">
          <button type="submit" class="btn btn-primary" id="submitbtn" name="submit" value="submit">ยืนยัน</button>
          <a href="<?php echo base_url("restaurant");?>" class="btn btn-default">ยกเลิก</a>
        </div>
      </div>
  </form>
</div>
